package aiku.numericalcontroloa.Controller.productTypeController;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import aiku.numericalcontroloa.Base.Utils.Result;
import aiku.numericalcontroloa.Model.Entity.productType.productType;
import aiku.numericalcontroloa.Service.productType.productTypeServiceImp;
import lombok.extern.slf4j.Slf4j;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;


@RestController
@RequestMapping("/productType")
@Slf4j
public class productTypeController {
    
    @Autowired
    private productTypeServiceImp productTypeService;

    @GetMapping("/getProductType")
    public Result getProductType() {
        return productTypeService.getProductType();
    }

    @PostMapping("/addProductType")
    public Result addProductType(@RequestBody productType data) {
        return productTypeService.addProductType(data);
    }

    @PostMapping("/updateProductType")
    public Result updateProductType(@RequestBody productType data) {
        return productTypeService.updateProductType(data);
    }

    @PostMapping("/deleteProductType")
    public Result deleteProductType(@RequestBody productType data) {
        return productTypeService.deleteProductType(data);
    }
    
}
